//
//  Common.h
//  YiZheWangXM
//
//  Created by apple on 14-8-11.
//  Copyright (c) 2014年 yzw. All rights reserved.
//

#ifndef YiZheWangXM_Common_h
#define YiZheWangXM_Common_h

#endif

#define kHomebaseurl @"http://a8.tvesou.com/v2/hot"
#define klivebaseurl @"http://a8.tvesou.com/right"
#define kJijinBaseurl @"http://cdn.a8.tvesou.com/right"
#define kRecommendBaseurl @"http://www.buyinball.com/app-web/api/info"
#define kScoreBaseurl @"http://www.buyinball.com/app-web/api/match"
#define kOddsBaseurl @"http://www.buyinball.com/app-web/api/odds"
#define kForumBaseurl @"http://23.234.49.240/api/topic"


#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;


// 1.判断是否为4寸屏幕
#define Screen4INCH ([UIScreen mainScreen].bounds.size.height == 480)

#define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]

// 2.屏幕宽高

#define GetHeight [UIScreen mainScreen].bounds.size.height //获取屏幕高度
#define GetWidth [UIScreen mainScreen].bounds.size.width  //获取屏幕宽度



//调试抛出异常
//#if 0//DEBUG
//#define DEBUG_NSAssert1(condition, desc, arg1) NSAssert((condition), (desc), (arg1))
//#else
//#define DEBUG_NSAssert1(condition, desc, arg1)
//#endif

//#define DEBUG_Log //NSLog(@"#%s##%d#",strrchr(__FILE__,'/'),__LINE__); NSLog
//#if DEBUG
//#define DEBUG_Log(x, ...) NSLog(x, ## __VA_ARGS__)
//#else
//#define DEBUG_Log(x, ...)
//#endif
#if DEBUG
#define DEBUG_Log(x, ...)
#else
#define DEBUG_Log(x, ...)
#endif

#define IsNull(x) ![(x) isKindOfClass:[NSNull class]] && (x) != nil
#define IsNullData(x) [(x) isKindOfClass:[NSNull class]]?@"":((x) == nil ? @"":(x))

#define WIDTH self.view.frame.size.width


#define app_Version [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]


#define UserDeviceUUID [[[UIDevice currentDevice]identifierForVendor] UUIDString]//uuid

// RGB颜色
#define HWColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]



// 随机色
#define HWRandomColor HWColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))
#define ApiDebugOpen_Act @"ApiDebugOpen"

#define RectMake(x, y, w, h)    CGRectMake(x, y, w, h)
#define UserDefault     [NSUserDefaults standardUserDefaults]

#define BackgroundColor  [UIColor colorWithRed:(244/255.0) green:(244/255.0) blue:(244/255.0) alpha:1];
#define UserDefalt_News       @"UserDefalt_News"//分享地址

#define CurrentUser @"currentUser"



//极光Key
#define AuroraKey     @"cf17c2ffd021a3cf3432c0db"
//BmobKey
#define BmobKey       @"d863879d3fa3d1dde9324801be8f500d"
//开关地址
#define SwitchAddress @"/Home/Outs/index/mchid/591035b264848.html"
//分享地址
#define ShareAddress  @"/Home/Outs/index/mchid/5910317b640a6.html"



